#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableLifeSkillDecomposeDao:DaoBase<TableLifeSkillDecompose>
    {
        public override string GetFileName()
        {
            return "TableLifeSkillDecompose.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableLifeSkillDecompose>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableLifeSkillDecompose model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableLifeSkillDecompose->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableLifeSkillDecompose ParseRowData(string[] rowData)
        {
            TableLifeSkillDecompose data = new TableLifeSkillDecompose();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.itemId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.costItems = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.skillType = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.skillLevel = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.costEnergy = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.addExp = int.Parse(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.rewards = rowData[7];
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.randomReward = rowData[8];
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.decomposeRule = rowData[9];
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.dropGroupIds = rowData[10];
            }
            return data;
        }
    }
}
